define([''],function () {
    return {
        path: '/',
        name: 'send',
        params: {},//对象，包含路由中的动态片段和全匹配片段的键值对
        query: {},//对象，包含路由中查询参数的键值对。
        matched: {},//数组，包含当前匹配的路径中所包含的所有片段所对应的配置参数对象。
        //redirect:'/b',//重定向
        component: function (resolve) {
            const Foo = {
                template:get('vue/demo.vue').responseText,
                props:['list'],
                data: function () {
                    return {
                        name: 'index',
                        a: 444,
                        listd:'8888888888'
                    }
                },
                methods: {
                    dianwo: function () {
                        console.log('点我干啥...');
                    },
                    fetchData:function () {
                        this.name = 777;
                    }
                },
                created:function () {
                    console.log('页面里面的组件渲染完VC1');
                    this.fetchData();
                    this.a = 555;
                    //组件渲染完成，渲染新组件
                    this.template = ''
                    require(['public/mobiscroll'],function () {});
                    //如何动态加载js来注册一个局部组件
                    Vue.component('async-example', function (resolve) {
                        require(['function'],function (e) {
                            resolve(e);
                        });
                    });
                    Vue.component('cityList', {
                        props: ['message'],
                        template: get('vue/cityList.vue').responseText,
                        data: function () {
                            return {
                                firstName: 'Walter',
                                lastName: 'White',
                                alias: 'Heisenberg',
                                hello:'你好，人类、。、。、',
                                name:''
                            }
                        },
                        ready:function () {
                            console.log('页面里面的组件渲染完VC2');
                        }
                    });
                    //组件渲染完成
                    this.$nextTick(function () {
                        var name = 'xixi';
                        this.name = name;
                        localStorage.setItem(name,JSON.stringify({a:7,b:7,c:2,d:4}));
                        console.log('页面里面的组件渲染完VC3');
                    })
                },
                beforeRouteEnter:function (to, from, next) {
                    next();
                    console.log('页面里面的组件渲染完VC4');
                },
                computed: {}
            };
            resolve(Foo);
        },
        //子路由
        subRoutes: {
            '/news': {},
            '/message': {}
        }
    }
});